package cn.gson.school.dao.jiaoxue;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import cn.gson.school.entity.jiaoxue.StudentEntity;
import cn.gson.school.entity.xitong.UserEntity;

@Repository
public interface StudentDao extends CrudRepository<StudentEntity, Long> {
	//根据学生姓名来查询
	StudentEntity findByStudentName(String name);
	
	StudentEntity findByUserId(UserEntity user);
	
	List<StudentEntity> findByClassId(Long id);
	
	StudentEntity findByAge(Integer age);
	
	@Query(value="from StudentEntity where state=?")
	List<StudentEntity> findByStudentState(String state);


}
